import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import com.yrd.thirdparty.gwapi.constants.Tables;

import java.nio.file.Paths;

public class GeneratorCode {


    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://10.10.0.145:3306/hiscloud?useSSL=false", "his-cloud", "his-cloud")
                .globalConfig(builder -> builder
                        .author("liubingjun")
                        .outputDir(Paths.get(System.getProperty("user.dir")) + "/src/main/java")
                        .commentDate("yyyy-MM-dd")
                )
                .packageConfig(builder -> builder
                        .parent("com.yrd.thirdparty.gwapi")
                        .entity("entity")
                        .mapper("mapper")
                        .service("service")
                        .serviceImpl("service.impl")
                        .xml("mapper.xml")
                )
                .strategyConfig(builder -> builder.addInclude(Tables.ygtTables)
                        .entityBuilder()
                        .enableLombok()
                        .enableFileOverride() //文件覆盖
                )
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();


    }
}
